function SuperType(name){
    this.name = name;
    this.colors = ["blue"];
}


function SubType(){
    //继承了SuperType并且还传递了参数name
    SuperType.call(this, "小明");
    this.age = 18;
}

var instance1 = new SubType();
var instance2 = new SubType();

instance1.colors.push("red");
alert(instance1.colors);
alert(instance2.colors);//没有blue

//借用构造函数的缺点:方法的函数对象无法复用